package com.springcloud.zuul.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.springcloud.zuul.common.validator.group.AddGroup;
import com.springcloud.zuul.common.validator.group.UpdateGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 系统配置信息
 *
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_config")
public class SysConfigEntity extends CommonEntity {
	@TableId
	private String guid;

	/**
	 * 配置编码
	 */
	@NotBlank(message = "配置编码不能为空！",groups = {AddGroup.class, UpdateGroup.class})
	private String configId;

	/**
	 * 配置关键字
	 */
	@NotBlank(message="配置关键字不能为空！",groups = {AddGroup.class,UpdateGroup.class})
	private String paramKey;

	/**
	 * 配置项内容
	 */
	@NotBlank(message="配置项内容不能为空!",groups = {AddGroup.class,UpdateGroup.class})
	private String paramValue;

	/**
	 * 状态   1.正常   0.停用
	 */
	@NotNull(message = "状态不能为空！",groups = {AddGroup.class,UpdateGroup.class})
	@Min(value = 0,message = "状态不合法！",groups = {AddGroup.class,UpdateGroup.class})
	@Max(value = 1,message = "状态不合法！",groups = {AddGroup.class,UpdateGroup.class})
	private int status;

	/**
	 * 配置项备注    说明当前配置用途
	 */
	private String remark;


}
